package com.qf.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 远程调用 缓存微服务
 * @author lixu
 */
@FeignClient(name = "SMS-PLATFORM-CACHE")
@RequestMapping("/cache")
public interface CacheFeign {


    //设置 Hash
    @RequestMapping(value = "/hmset/{key}", method = RequestMethod.POST)
    public boolean hMSet(@PathVariable("key") String key, @RequestBody Map map);

    //获取值的 （整个HashMap的数据）
    @RequestMapping(value = "/hmget/{key}", method = RequestMethod.GET)
    public Map hMGet(@PathVariable("key") String key);

    //获取值  （单个值
    @RequestMapping(value = "/hget/{key}/{field}",method = RequestMethod.POST)
    public String hget(@PathVariable(value = "key") String key,@PathVariable(value = "field") String field);
}
